/**
 * 该文件只维护项目整体布局样式，不能随便修改本文件内容，以免页面布局错乱
 * App整体结构：
 * app (container)
 *   |-header
 *   |   |--header-head (logo)
 *   |   |--header-body (menu)
 *   |   |--header-foot (userinfo)
 *   |-main
 *   |   |--sider
 *   |   |    |---aside-head (aside menu title)
 *   |   |    |---aside-body (aside menu)
 *   |   |    |---aside-foot (aside toggle)
 *   |   |--content
 *   |   |    |---content-head (breadcrumb)
 *   |   |    |---content-body (route [section])
 *   |   |    |---content-foot (copyright)
 *   |-footer
 *   |   |--copyright
 *
 * App模块结构
 *
 * Section结构：
 * section (container)
 *   |-head (breadcrumb)
 *   |-main (table、form)
 *   |   |--sider (setting)
 *   |   |--content (table、form)
 *   |-foot (operate)
 *
 * App搜索表单
 *
 */

.is-border {
  position: relative;

  &::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    border-width: 1px;
    border-style: solid;
    border-color: #f00;
  }

  &-top {
    &::after {
      top: 0;
      bottom: auto;
      border-width: 0;
      border-top-width: 1px;
    }
  }

  &-bottom {
    &::after {
      bottom: 0;
      top: auto;
      border-width: 0;
      border-bottom-width: 1px;
    }
  }

  &-left {
    &::after {
      top: 0;
      bottom: 0;
      right: auto;
      border-width: 0;
      border-left-width: 1px;
    }
  }

  &-right {
    &::after {
      top: 0;
      bottom: 0;
      left: auto;
      border-width: 0;
      border-right-width: 1px;
    }
  }
}

.containerCss {
  position: relative;
  display: flex;
  flex: auto;
  flex-direction: column;
  flex-wrap: wrap;
  min-height: 0;
  background-color: #666;

  &.has-sider,
  &.is-horizontal {
    flex-direction: row;
  }

  &.is-abs {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
  }
}

.headerCss {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  background-color: #333;
}

.footerCss {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  background-color: #999;
}

.siderCss {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  width: 200px;
  min-width: 0;
  overflow: hidden;
  transition: all 0.2s;
  background-color: #222;
}

.contentCss {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;

  background-color: #444;

  &.is-horizontal {
    flex-direction: row;
  }
}

.contentHeadCss {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.contentFootCss {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.contentBodyCss {
  display: flex;
  flex: auto;
  flex-direction: column;

  position: relative;
  width: 100%;
}

/**
 * section-layout: 项目模块整体布局-上中（左右）下
 */
@layout-module-prefix-cls: ~'section-layout';

.@{layout-module-prefix-cls} {
  .containerCss();

  &-header {
    .headerCss();

    &-head {
      .contentHeadCss();
    }

    &-body {
      .contentBodyCss();

      flex-direction: row;
      align-items: center;
      justify-content: space-between;
    }

    &-foot {
      .contentFootCss();
    }
  }

  &-footer {
    .footerCss();
  }

  &-sider {
    .siderCss();

    overflow: hidden;

    &-head {
      .contentHeadCss();
    }

    &-body {
      .contentBodyCss();

      overflow-y: auto;
      overflow-x: hidden;
    }

    &-foot {
      .contentFootCss();
    }
  }

  &-content {
    .contentCss();

    overflow: hidden;

    &-head {
      .contentHeadCss();
    }

    &-body {
      .contentBodyCss();

      overflow-y: auto;
      overflow-x: hidden;
      padding: 20px;
    }

    &-foot {
      .contentFootCss();
    }
  }

  /** 操作条 */
  &-operate {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    max-width: 100%;
    padding: 12px 20px;

    &.is-left {
      justify-content: flex-start;
    }

    &.is-right {
      justify-content: flex-end;
    }
  }
}
